/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.me.entityBeans;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "T_CENTRO_ESTUDIOS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TCentroEstudios.findAll", query = "SELECT t FROM TCentroEstudios t"),
    @NamedQuery(name = "TCentroEstudios.findByNIdCentroEstudioPk", query = "SELECT t FROM TCentroEstudios t WHERE t.nIdCentroEstudioPk = :nIdCentroEstudioPk"),
    @NamedQuery(name = "TCentroEstudios.findByVNombreCentroEstudio", query = "SELECT t FROM TCentroEstudios t WHERE t.vNombreCentroEstudio = :vNombreCentroEstudio")})
public class TCentroEstudios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "N_ID_CENTRO_ESTUDIO_PK")
    private Integer nIdCentroEstudioPk;
    @Column(name = "V_NOMBRE_CENTRO_ESTUDIO")
    private String vNombreCentroEstudio;
    @OneToMany(mappedBy = "nIdCentroEstudiosFk")
    private Collection<TClientes> tClientesCollection;
    @JoinColumn(name = "N_ID_PAIS_FK", referencedColumnName = "N_ID_PAIS_PK")
    @ManyToOne
    private TPaises nIdPaisFk;
    @JoinColumn(name = "N_ID_DEPARTAMENTO_FK", referencedColumnName = "N_ID_DEPARTAMENTO_PK")
    @ManyToOne
    private TDepartamentos nIdDepartamentoFk;

    public TCentroEstudios() {
    }

    public TCentroEstudios(Integer nIdCentroEstudioPk) {
        this.nIdCentroEstudioPk = nIdCentroEstudioPk;
    }

    public Integer getNIdCentroEstudioPk() {
        return nIdCentroEstudioPk;
    }

    public void setNIdCentroEstudioPk(Integer nIdCentroEstudioPk) {
        this.nIdCentroEstudioPk = nIdCentroEstudioPk;
    }

    public String getVNombreCentroEstudio() {
        return vNombreCentroEstudio;
    }

    public void setVNombreCentroEstudio(String vNombreCentroEstudio) {
        this.vNombreCentroEstudio = vNombreCentroEstudio;
    }

    @XmlTransient
    public Collection<TClientes> getTClientesCollection() {
        return tClientesCollection;
    }

    public void setTClientesCollection(Collection<TClientes> tClientesCollection) {
        this.tClientesCollection = tClientesCollection;
    }

    public TPaises getNIdPaisFk() {
        return nIdPaisFk;
    }

    public void setNIdPaisFk(TPaises nIdPaisFk) {
        this.nIdPaisFk = nIdPaisFk;
    }

    public TDepartamentos getNIdDepartamentoFk() {
        return nIdDepartamentoFk;
    }

    public void setNIdDepartamentoFk(TDepartamentos nIdDepartamentoFk) {
        this.nIdDepartamentoFk = nIdDepartamentoFk;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nIdCentroEstudioPk != null ? nIdCentroEstudioPk.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TCentroEstudios)) {
            return false;
        }
        TCentroEstudios other = (TCentroEstudios) object;
        if ((this.nIdCentroEstudioPk == null && other.nIdCentroEstudioPk != null) || (this.nIdCentroEstudioPk != null && !this.nIdCentroEstudioPk.equals(other.nIdCentroEstudioPk))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.me.entityBeans.TCentroEstudios[ nIdCentroEstudioPk=" + nIdCentroEstudioPk + " ]";
    }
    
}
